package com.itheima.homework.BigDecimal;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

public class TestStudents {
    public static void main(String[] args) {

        Students s1=new Students("张三","男",20,79.5);
        Students s2=new Students("李四","女",21,80.2);
        Students s3=new Students("王五","男",22,77.9);
        Students s4=new Students("周六","男",20,55.8);
        Students s5=new Students("赵七","女",21,99.9);
        double avg=(s1.getScore()+s2.getScore()+s3.getScore()+s4.getScore()+s5.getScore())/5;
        BigDecimal b=new BigDecimal(avg);
        BigDecimal bigDecimal = b.setScale(2, BigDecimal.ROUND_HALF_UP);
        System.out.println("bigDecimal = " + bigDecimal);
    }

}
